package com.zmc.order.feign;

import com.zmc.common.domain.good.GoodSkuBuyDetail;
import com.zmc.common.domain.vo.good.GoodsUpVo;
import com.zmc.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author：zmc
 * @Date：2024/11/7 14:28
 */

@FeignClient("mall-product")
public interface ProductFeignService {
    /**
     * 下单：锁定库存
     */
    @RequestMapping("/commodity/stock/lock")
    public R lockStock(@RequestBody List<GoodsUpVo> list);
    /**
     * 已支付：扣减库存
     */
    @RequestMapping("/commodity/stock/reduce")
    public R reduceStock(@RequestBody List<GoodsUpVo> list);

    /**
     * 取消订单：返锁定库存
     */
    @RequestMapping("/commodity/stock/unlock")
    public R unlockStock(@RequestBody List<GoodsUpVo> list);
    /**
     * 申请退款：返扣减库存
     */
    @RequestMapping("/commodity/stock/return")
    public R returnReduceInventory(@RequestBody List<GoodsUpVo> list);


    /**
     * 计算商品体积、种类
     * */
    @PostMapping("/commodity/goods/count/weight")
    public R countWeightVolume(@RequestBody List<GoodSkuBuyDetail> list);
}
